﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BusinessManagementStudio.ViewModel.ReportView>" ContentType="text/json" %>
<%@ Import Namespace="System.Globalization" %>

{rows:[<% for (var i = 0; i < Model.InvoiceList.Count; i++ ){ %>
    {"id":"<%=Model.InvoiceList[i].ID%>", 
        "data":[    
                "<%= Model.InvoiceList[i].RefNo != null ? Model.InvoiceList[i].RefNo : ""%>", 
                "<%= Model.InvoiceList[i].InvoiceNo != null ? Model.InvoiceList[i].InvoiceNo : ""%>",
                "<%= Model.InvoiceList[i].QuotationNo != null ? Model.InvoiceList[i].QuotationNo : ""%>",
                "<%= Model.InvoiceList[i].Description != null ? Model.InvoiceList[i].Description : ""%>",
                "<%= Model.InvoiceList[i].WorkOrderNo != null ? Model.InvoiceList[i].WorkOrderNo : ""%>",
                "<%= Model.InvoiceList[i].PurchaseOrderNo != null ? Model.InvoiceList[i].PurchaseOrderNo : ""%>",
                "<%= Model.InvoiceList[i].InvoiceDate != null ? Model.InvoiceList[i].InvoiceDate.ToString("yyyy-MMM-dd", CultureInfo.CreateSpecificCulture("en-US")) : ""%>",
                "<%= Model.InvoiceList[i].AmountInHKD != null ? Model.InvoiceList[i].AmountInHKD.ToString("#,##0.00") : ""%>",
                "<%= Model.InvoiceList[i].IsReceived != true ? "0" : "1"%>",
                "<%= Model.InvoiceList[i].ReceivedRef != "" ? Model.InvoiceList[i].ReceivedRef : ""%>",
                "<%= Model.InvoiceList[i].ReceivedDate != null ? Model.InvoiceList[i].ReceivedDate.Value.ToString("yyyy-MMM-dd", CultureInfo.CreateSpecificCulture("en-US")) : ""%>"
            ]}<%= i < Model.InvoiceList.Count ? "," : ""%>               
<% } %>]}

